//#include<iostream.h>
//#include<fstream.h>
//#include<limits.h>
#include<math.h>
//#include<values.h>
#include"rsc_encoder.h"


class modified_bahl_decoder
{
	private:

	int L,K,N,k_number,n_number,state_number;
   unsigned int ** D,** D1;

   long double ** alfa,** beta;
   long double sigma;
   
 	rsc_encoder *encoder;

	public:

	modified_bahl_decoder(rsc_encoder *_encoder,unsigned int L,long double _sigma);
	modified_bahl_decoder(rsc_encoder *_encoder,unsigned int L);
	~modified_bahl_decoder();

   long double * modified_bahl_decoding(long double *** _R,long double * LU,unsigned int flag);
   long double get_gamma(unsigned int _bit,unsigned int _m1,unsigned int _m2,unsigned int _k,long double ** _R,long double LU);

	unsigned int * convert_decimal_binary(unsigned int decimal,unsigned int size);
	unsigned int convert_binary_decimal(unsigned int * binary,unsigned int size);
   void set_sigma(long double _sigma) { sigma=_sigma; }
};


